package com.keeping.aiimagery.controller;


import com.keeping.aiimagery.entity.OrdersServices;
import com.keeping.aiimagery.entity.QueryVo;
import com.keeping.aiimagery.service.OrdersServicesService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 消费记录 前端控制器
 * </p>
 *
 * @author keeping
 * @since 2023-04-05
 */
@Controller
@RequestMapping("/ordersServices")
public class OrdersServicesController {
    @Resource
    private OrdersServicesService ordersServicesService;

    //服务记录的分页查询
    @PostMapping("/pageById")
    @ResponseBody
    public List<OrdersServices> pageById(@RequestBody QueryVo queryVo){
        return ordersServicesService.selectByPage(queryVo);
    }

    @GetMapping("/countByUserId")
    @ResponseBody
    public int sumByUserId(@RequestParam int userId){
        return ordersServicesService.coutById(userId);
    }

}

